﻿// Inner Fire 游戏引擎库
// PhysicsBoneSetting - 动态服装/骨骼配置
//
// Copyright (c) 2025 by 尔西大帝. All rights reserved.
//
// 所属层级：应用层（4）
// 动态服装/骨骼。用于配置不同形态的参数。比如头发，胸部，衣服，裙子等等。
//
// Author: 尔西大帝
// Email: 2670613871@qq.com
// Created: 2025-06-19

#include "physics_bone_setting.h"
#include <graphics/imath.h>

namespace ifire::game {

PhysicsBoneSetting::PhysicsBoneSetting(
    ConfigManager* manager, const ikit::XmlNode& node)
    : ConfigInfo(manager, node("Name"))
    , damping(node("Damping", 0.1f))
    , elasticity(node("Elasticity", 0.1f))
    , stiffness(node("Stiffness", 0.1f))
    , inert(node("Inert", 0.0f))
    , velocity_scale(node("VelocityScale", 0.1f))
    , wave(node("Wave"))
    , wave_time(node("WaveTime"))
    , gravity(node("Gravity"))
    , end_offset(node("EndOffset"))
    , end_length(node("EndLength")) {
  has_wave = imath::len(wave) > F_EPSILON;
  has_end = imath::len(end_offset) > F_EPSILON || end_length > F_EPSILON;
}

PhysicsBoneSetting::~PhysicsBoneSetting() {}

} // namespace ifire::game